Part Number Hot Search : 
16160 95R3FKR3 RN47A7JE TRONIC 406005G CP20147H 06000 LTC341
Product Description
Full Text Search
 

To Download TLC156 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  TLC156 eprom/rom-based 8-bit microcontroller series this datasheet contains new product inform99032685ation. tlc reserves the rights to modify the product specification without notice. no liability is assumed as a result of the use of this product. no rights under any patent accompany the sales of the product. rev0.95 nov 20, 2003 p.1/tlc 156 tlc devices included in this data sheet: ? tlc154/155/156/157 : eprom devices ? tlc154/155/156/157 : mask rom devices features ? only 42 single word instructions ? all instructions are single cycle except for program branches which are two-cycle ? 13-bit wide instructions ? 8-bit wide data path ? 5-level deep hardware stack ? operating speed: dc-20 mhz clock input dc-100 ns instruction cycle device pins # i/o # eprom/rom (byte) ram (byte) tlc154 18 12 512 49 tlc155 28 20 512 48 TLC156 18 12 1k 49 tlc157 28 20 2k 96 ? direct, indirect addressing modes for data accessing ? 8-bit real time clock/counter (timer0) with 8-bit programmable prescaler ? internal power-on reset (por) ? built-in low voltage detector (lvd) for brown-out reset (bor) ? power-up reset timer (pwrt) and oscillator start-up timer(ost) ? on chip watchdog timer (wdt) with internal oscillator for reliable operation and soft-ware watch-dog enable/disable control ? three i/o ports ioa, iob and ioc with independent direction control ? soft-ware i/o pull-high/pull-down or open-drain control ? one internal interrupt source: timer0 overflow; two external interrupt source: int pin, port b input change ? wake-up from sleep by int pin or port b input change ? power saving sleep mode ? programmable code protection ? selectable oscillator options: - rc: resistor/capacitor oscillator - xt: crystal/resonator oscillator - hf: high frequency crystal/resonator oscillator - lf: low frequency crystal oscillator ? wide-operating voltage range: - eprom : 2.3v to 5.5v - rom : 2.3v to 5.5v tel:13798484366 13798484366
TLC156 rev0.95 nov 20, 2003 p.2/TLC156 general description the TLC156 series is a family of low-cost, high speed, high noise immunity, eprom/rom-based 8-bit cmos microcontrollers. it employs a risc architecture with only 42 instructions. all instructions are single cycle except for program branches which take two cycles. the easy to use and easy to remember instruction set reduces development time significantly. the TLC156 series consists of power-on reset (por), brown-out reset (bor), power-up reset timer (pwrt), oscillator start-up timer(ost), watchdog timer, eprom/rom, sram, tri-state i/o port, i/o pull-high/open-drain/pull-down control, power saving sleep mode, real time programmable clock/counter, interrupt, wake-up from sleep mode, and code protection for eprom products. there are four oscillator configurations to choose from, including the power-saving lp (low power) oscillator and cost saving rc oscillator. the tlc154 and tlc155 address 51213 of program memory, the TLC156 address 1k13 of program memory, and the tlc157 address 2k13 of program memory. the TLC156 can directly or indirectly address its register files and data memory. all special function registers including the program counter are mapped in the data memory. block diagram alu watchdog timer oscillator circuit timer0 porta portb portc program counter 5-level stack eprom / rom sram instruction decoder accumulator fsr interrupt control tl c
pin connection pdip, sop ssop pdip, sop ssop pin descriptions name i/o description ioa0 ~ ioa3 i/o ioa0 ~ ioa3 as bi-direction i/o port iob0/int i/o bi-direction i/o pin with system wake-up function / external interrupt input iob1 ~ iob7 i/o bi-direction i/o port with system wake-up function ioc0 ~ ioc7 i/o bi-direction i/o port t0cki i clock input to timer0. must be tied to vss or vdd, if not in use, to reduce current consumption rstb i system clear (reset) input. this pin is an active low reset to the device. osci i x?tal type: oscillator crystal input rc type: clock input of rc oscillator osco o x?tal type: oscillator crystal output. rc mode: outputs with the instruction cycle rate vdd - positive supply vss - ground legend: i=input, o=output, i/o=input/output tlc154 TLC156 ioa2 18 1 17 16 15 14 13 12 11 10 2 3 4 5 6 7 8 9 ioa3 t0cki rstb vss iob0/int iob1 iob2 iob3 ioa0 osci ioa1 osco iob7 iob6 vdd iob5 iob4 tlc155 tlc157 t0cki 28 1 27 26 25 24 23 22 21 20 19 18 17 16 15 2 3 4 5 6 7 8 9 10 11 12 13 14 vdd nc vss nc ioa0 ioa1 ioa2 ioa3 iob0/int iob1 iob2 iob3 iob4 osci osco rstb ioc7 ioc5 ioc4 ioc6 ioc3 ioc1 ioc0 ioc2 iob7 iob5 iob6 tlc154 TLC156 ioa2 ioa3 t0cki rstb vss vss iob0/int iob1 iob2 ioa0 osci ioa1 osco vdd iob7 vdd iob6 iob5 iob3 iob4 20 1 19 18 17 16 15 14 13 12 2 3 4 5 6 7 8 9 11 10 tlc155 tlc157 vss 28 1 27 26 25 24 23 22 21 20 19 18 17 16 15 2 3 4 5 6 7 8 9 10 11 12 13 14 t0cki vdd vdd ioa0 ioa1 ioa2 ioa3 iob0/int iob1 iob2 iob3 iob4 vss osci osco rstb ioc7 ioc5 ioc4 ioc6 ioc3 ioc1 ioc0 ioc2 iob7 iob5 iob6 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
1.0 memory organization TLC156 memory is organized into program memory and data memory. 1.1 program memory organization the tlc154/155 have a 9-bit program counter (pc) capable of addressing a 51213 program memory space. the TLC156 have a 10-bit program counter capable of addressing a 1k13 program memory space. the tlc157 have an 11-bit program counter capable of addressing a 2k13 program memory space. the reset vector for the tlc154/155 is at 1ffh. the reset vector for the TLC156 is at 3ffh. the reset vector for the tlc157 is at 7ffh. the h/w interrupt vector is at 008h. and the s/w interrupt vector is at 002h. tlc157 has program memory size greater than 1k words, but the call and goto instructions only have a 10-bit address range. this 10-bit address range allows a branch within a 1k program memory page size. to allow call and goto instructions to address the entire 2k program memory address range for tlc157, there is another one bit to specify the program memory page. this paging bit comes from the pchbuf<2> bit. when doing a call or goto instruction, the user must ensure that page bit pchbuf<2> are programmed so that the desired program memory page is addressed. when one of the return instructions is executed, the entire 11-bit pc is poped from the stack. therefore, manipulation of the pchbuf <2> is not required for the return instructions. figure 1.1: program memory map and stack pc<10:0> stack 1 stack 2 pc<9:0> stack 3 stack 4 stack 5 stack 1 stack 2 7ffh reset vector pc<8:0> stack 3 stack 4 stack 5 stack 1 stack 2 3ffh reset vector stack 3 stack 4 : stack 5 : 1ffh reset vector : : : : 008h h/w interrupt vector 008h h/w interrupt vector 008h h/w interrupt vector 002h s/w interrupt vector 002h s/w interrupt vector 002h s/w interrupt vector 000h 000h 000h tlc154/155 TLC156 tlc157 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
1.2 data memory organization data memory is composed of special function registers and general purpose registers. the general purpose registers are accessed either directly or indirectly through the fsr register. the special function registers are registers used by the cpu and peripheral functions to control the operation of the device. in tlc157, the data memory is partitioned into four banks. switching between these banks requires the rp1 and rp0 bits in the fsr register to be configured for the desired bank. table 1.1: operational registers map address name b7 b6 b5 b4 b3 b2 b1 b0 n/a (w) option - intedg t0cs t0se psa ps2 ps1 ps0 n/a (w) iosta port a i/o control register n/a (w) iostb port b i/o control register n/a (w) iostc port c i/o control register 00h (r/w) indf uses contents of fsr to address data memory (not a physical register) 01h (r/w) tmr0 8-bit real-time clock/counter 02h (r/w) pcl low order 8 bits of pc 03h (r/w) status gp2 gp1 gp0 to pd z dc c 04h (r/w) fsr rp1 (3) rp0 (3) indirect data memory address pointer 05h (r/w) porta - - - - ioa3 ioa2 ioa1 ioa0 06h (r/w) portb iob7 iob6 iob5 iob4 iob3 iob2 iob1 iob0 07h (r/w) portc (1) ioc7 ioc6 ioc5 ioc4 ioc3 ioc2 ioc1 ioc0 08h (r/w) pcon wdte eis lvdte roc - - - - 09h (r/w) wucon wub7 wub6 wub5 wub4 wub3 wub2 wub1 wub0 0ah (r/w) pchbuf (2) - - - - - upper 3 bits buffer of pc 0bh (r/w) pdcon /pdb3 /pdb2 /pdb1 /pdb0 /pda3 /pda2 /pda1 /pda0 0ch (r/w) odcon odb7 odb6 odb5 odb4 odb3 odb2 odb1 odb0 0dh (r/w) phcon /phb7 /phb6 /phb5 /phb4 /phb3 /phb2 /phb1 /phb0 0eh (r/w) inten gie - - - - intie pbie t0ie 0fh (r/w) intflag - - - - - intif pbif t0if legend: - = unimplemented, read as ?0?, note 1 : portc is an 8-bit i/o register for tlc155/157. portc is a general purpose register for tlc154/156. 2 : there is only 1 bit in tlc154/155. there are only 2 bits in TLC156. and there are 3 bits in tlc157. 3 : for tlc154/155/156, these bits are not used, read as ?1? tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
table 1.2: registers file map for tlc154/155/156 address description 00h indf 01h tmr0 02h pcl 03h status 04h fsr 05h porta 06h portb 07h portc 08h pcon 09h wucon 0ah pchbuf 0bh pdcon 0ch odcon 0dh phcon 0eh inten 0fh intflag 10h | 3fh general purpose registers table 1.3: registers file map for tlc157 description fsr<7:6> address 0 0 bank 0 0 1 bank 1 1 0 bank 2 1 1 bank 3 00h indf 01h tmr0 02h pcl 03h status 04h fsr 05h porta 06h portb 07h portc 08h pcon 09h wucon 0ah pchbuf 0bh pdcon 0ch odcon 0dh phcon 0eh inten 0fh intflag 10h | 2fh general purpose registers memory back to address in bank 0 30h | 3fh general purpose registers general purpose registers general purpose registers general purpose registers tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.0 functional descriptions 2.1 operational registers 2.1.1 indf (indirect addressing register) address name b7 b6 b5 b4 b3 b2 b1 b0 00h (r/w) indf uses contents of fsr to address data memory (not a physical register) the indf register is not a physical register. any instruction accessing the indf register can actually access the register pointed by fsr register. reading the indf register itself indirectly (fsr=?0?) will read 00h. writing to the indf register indirectly results in a no-operation (although status bits may be affected). the bits 5-0 of fsr register are used to select up to 64 registers (address: 00h ~ 3fh). in tlc157, the data memory is partitioned into four banks. switching between these banks requires the rp1 and rp0 bits in the fsr register to be configured for the desired bank. the lower locations of each bank are reserved for the special function registers. above the special function registers are general purpose registers. all special function registers and some of general purpose registers from bank 0 are mirrored in other banks for code reduction and quicker access. accessed bank rp1:rp0 0 0 0 1 0 1 2 1 0 3 1 1 example 2.1: indirect addressing ? ? ??????? ? ? ??????? ? ? ???????? ? ? ???????????? ? ? ?????????? ? ? ????????????? ? ? ?????? ? ??? ? ???????? ? ???? ????????????????????????? ??? ?????????? ?? ? ??????????????? ? ??? ????????????????????????? ????????????????????????? ????????????????????????? ??? ? ??? ? ????????????? ????????????????????? ? ????????????????????????? ????????????????????????? ????????????????????????? ????????????????????????? ????????????????????????? ????????? ? ??????????????? ? ? ? ? ???? ??
figure 2.2: direct/indirect addressing for tlc157 direct addressing indirect addressing rp1:rp0 5 from opcode 0 5 from fsr register 0 0 0 0 1 1 0 1 1 location select 00h location select addressing indf register 3fh 2.1.2 tmr0 (time clock/counter register) address name b7 b6 b5 b4 b3 b2 b1 b0 01h (r/w) tmr0 8-bit real-time clock/counter the timer0 is a 8-bit timer/counter. the clock source of timer0 can come from the instruction cycle clock or by an external clock source (t0cki pin) defined by t0cs bit (option<5>). if t0cki pin is selected, the timer0 is increased by t0cki signal rising/falling edge (selected by t0se bit (option<4>)). the prescaler is assigned to timer0 by clearing the psa bit (option<3>). in this case, the prescaler will be cleared when tmr0 register is written with a value. 2.1.3 pcl (low bytes of program counter) & stack address name b7 b6 b5 b4 b3 b2 b1 b0 02h (r/w) pcl low order 8 bits of pc TLC156 devices have a 9-bit (for tlc154/155) or 10-bit (for TLC156) or 11-bit (for tlc157) wide program counter (pc) and five-level deep 9-bit (10-bit, or 11-bit) hardware push/pop stack. the low byte of pc is called the pcl register. this register is readable and writable. the high byte of pc is called the pch register. this register contains the pc<10:8> bits and is not directly readable or writable. all updates to the pch register go through the pchbuf register. as a program instruction is executed, the program counter will contain the address of the next program instruction to be executed. the pc value is increased by one, every instruction cycle, unless an instruction changes the pc. for a goto instruction, the pc<9:0> is provided by the goto instruction word. the pc<10> is updated from the pchbuf<2>. the pcl register is mapped to pc<7:0>, and the pchbuf register is not updated. for a call instruction, the pc<9:0> is provided by the call instruction word. the pc<10> is updated from the pchbuf<2>. the next pc will be loaded (pushed) onto the top of stack. the pcl register is mapped to pc<7:0>, and the pchbuf register is not updated. for a retia, retfie, or return instruction, the pc are updated (poped) from the top of stack. the pcl register is mapped to pc<7:0>, and the pchbuf register is not updated. for any instruction where the pcl is the destination, the pc<7:0> is provided by the instruction word. however, the pc<10:8> will come from the pchbuf<2:0> register (pchbuf pch). pchbuf register is never updated with the contents of pch. bank select tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
figure 2.2: loading of pc in different situations situation 1: goto instruction pch pcl 10 9 8 7 0 pc - - - - - pchbuf situation 2: call instruction pch pcl 10 9 8 7 0 pc - - - - - pchbuf situation 3: retia, retfie, or return instruction pch pcl 10 9 8 7 0 pc - - - - - pchbuf situation 4: instruction with pcl as destination pch pcl 10 9 8 7 0 pc - - - - - pchbuf note: 1. bits pc<10:9> and pchbuf<2:1> are unimplemented for tlc154/155. bits pc<10> and pchbuf<2> are unimplemented for TLC156. 2. pchbuf is used only for instruction with pcl as destination for tlc154/155/156. pchbuf is used for instruction with pcl as destination, goto and call instructions for tlc157. opcode<9:0> pchbuf<2:0> alu result<7:0> or opcode<7:0> stack<10:0> stack<10:0> pchbuf<2> opcode<9:0> pchbuf<2> tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.1.4 status (status register) address name b7 b6 b5 b4 b3 b2 b1 b0 03h (r/w) status gp2 gp1 gp0 to pd z dc c this register contains the arithmetic status of the alu, the reset status. if the status register is the destination for an instruction that affects the z, dc or c bits, then the write to these three bits is disabled. these bits are set or cleared according to the device logic. furthermore, the to and pd bits are not writable. therefore, the result of an instruction with the status register as destination may be different than intended. for example, clrr status will clear the upper three bits and set the z bit. this leaves the status register as 000u u1uu (where u = unchanged). c : carry/borrow bit. addar, addia = 1, a carry occurred. = 0, a carry did not occur. subar, subia = 1, a borrow did not occur. = 0, a borrow occurred. note : a subtraction is executed by adding the two?s complement of the second operand. for rotate (rrr, rlr) instructions, this bit is loaded with either the high or low order bit of the source register. dc : half carry/half borrow bit. addar, addia = 1, a carry from the 4th low order bit of the result occurred. = 0, a carry from the 4th low order bit of the result did not occur. subar, subia = 1, a borrow from the 4th low order bit of the result did not occur. = 0, a borrow from the 4th low order bit of the result occurred. z : zero bit. = 1, the result of a logic operation is zero. = 0, the result of a logic operation is not zero. pd : power down flag bit. = 1, after power-up or by the clrwdt instruction. = 0, by the sleep instruction. to : time overflow flag bit. = 1, after power-up or by the clrwdt or sleep instruction. = 0, a watch-dog time overflow occurred. gp2:gp0 : general purpose read/write bits. 2.1.5 fsr (indirect data memory address pointer) address name b7 b6 b5 b4 b3 b2 b1 b0 04h (r/w) fsr rp1 rp0 indirect data memory address pointer bit5:bit0 : select registers address in the indirect addressing mode. see 2.1.1 for detail description. rp1:rp0 : for tlc154/155/156, these bits are not used. read as ?1?s. for tlc157, these bits are used to switching the bank of four data memory banks. see 2.1.1 for detail description. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.1.6 porta, portb & portc (port data registers) address name b7 b6 b5 b4 b3 b2 b1 b0 05h (r/w) porta - - - - ioa3 ioa2 ioa1 ioa0 06h (r/w) portb iob7 iob6 iob5 iob4 iob3 iob2 iob1 iob0 07h (r/w) portc ioc7 ioc6 ioc5 ioc4 ioc3 ioc2 ioc1 ioc0 reading the port (porta, portb, portc register) reads the status of the pins independent of the pin?s input/output modes. writing to these ports will write to the port data latch. porta is a 4-bit port data register. only the low order 4 bits are used (porta<3:0>). bits 7-4 are unimplemented and read as ?0?s. portb is a 8-bit port data register. portc is a 8-bit port data register for tlc155/157, or a general purpose register for tlc154/156. 2.1.7 pcon (power control register) address name b7 b6 b5 b4 b3 b2 b1 b0 08h (r/w) pcon wdte eis lvdte roc - - - - bit3:bit0 : not used. read as ?0?s. roc : r-option function of ioa0 and ioa1 pins enable bit. = 0, disable the r-option function. = 1, enable the r-option function. in this case, if a 430k ?????? ??????? ?????? ??? ?? ??????? ????????????? ??????????????????????? ?????????????????????? ? ?????? ??? ?? ??????? ????????? ???????????? ?????????? ???????????? ?????????? ???????????? ?????????? ??? ?
wub3 : = 0, disable the input change interrupt/wake-up function of iob3 pin. = 1, enable the input change interrupt/wake-up function of iob3 pin. wub4 : = 0, disable the input change interrupt/wake-up function of iob4 pin. = 1, enable the input change interrupt/wake-up function of iob4 pin. wub5 : = 0, disable the input change interrupt/wake-up function of iob5 pin. = 1, enable the input change interrupt/wake-up function of iob5 pin. wub6 : = 0, disable the input change interrupt/wake-up function of iob6 pin. = 1, enable the input change interrupt/wake-up function of iob6 pin. wub7 : = 0, disable enable the input change interrupt/wake-up function of iob7 pin. = 1, enable the input change interrupt/wake-up function of iob7 pin. 2.1.9 pchbuf (high byte buffer of program counter) address name b7 b6 b5 b4 b3 b2 b1 b0 0ah (r/w) pchbuf - - - - - upper 3 bits buffer of pc there is only 1 bit in tlc154/155. there are only 2 bits in TLC156. and there are 3 bits in tlc157. see 2.1.3 for detail description. 2.1.10 pdcon (pull-down control register) address name b7 b6 b5 b4 b3 b2 b1 b0 0bh (r/w) pdcon /pdb3 /pdb2 /pdb1 /pdb0 /pda3 /pda2 /pda1 /pda0 /pda0 : = 0, enable the internal pull-down of ioa0 pin. = 1, disable the internal pull-down of ioa0 pin. /pda1 : = 0, enable the internal pull-down of ioa1 pin. = 1, disable the internal pull-down of ioa1 pin. /pda2 : = 0, enable the internal pull-down of ioa2 pin. = 1, disable the internal pull-down of ioa2 pin. /pda3 : = 0, enable the internal pull-down of ioa3 pin. = 1, disable the internal pull-down of ioa3 pin. /pdb0 : = 0, enable the internal pull-down of iob0 pin. = 1, disable the internal pull-down of iob0 pin. /pdb1 : = 0, enable the internal pull-down of iob1 pin. = 1, disable the internal pull-down of iob1 pin. /pdb2 : = 0, enable the internal pull-down of iob2 pin. = 1, disable the internal pull-down of iob2 pin. /pdb3 : = 0, enable the internal pull-down of iob3 pin. = 1, disable the internal pull-down of iob3 pin. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.1.11 odcon (open-drain control register) address name b7 b6 b5 b4 b3 b2 b1 b0 0ch (r/w) odcon odb7 odb6 odb5 odb4 odb3 odb2 odb1 odb0 odb0 : = 0, disable the internal open-drain of iob0 pin. = 1, enable the internal open-drain of iob0 pin. odb1 : = 0, disable the internal open-drain of iob1 pin. = 1, enable the internal open-drain of iob1 pin. odb2 : = 0, disable the internal open-drain of iob2 pin. = 1, enable the internal open-drain of iob2 pin. odb3 : = 0, disable the internal open-drain of iob3 pin. = 1, enable the internal open-drain of iob3 pin. odb4 : = 0, disable the internal open-drain of iob4 pin. = 1, enable the internal open-drain of iob4 pin. odb5 : = 0, disable the internal open-drain of iob5 pin. = 1, enable the internal open-drain of iob5 pin. odb6 : = 0, disable the internal open-drain of iob6 pin. = 1, enable the internal open-drain of iob6 pin. odb7 : = 0, disable the internal open-drain of iob7 pin. = 1, enable the internal open-drain of iob7 pin. 2.1.12 phcon (pull-high control register) address name b7 b6 b5 b4 b3 b2 b1 b0 0dh (r/w) phcon /phb7 /phb6 /phb5 /phb4 /phb3 /phb2 /phb1 /phb0 /phb0 : = 0, enable the internal pull-high of iob0 pin. = 1, disable the internal pull-high of iob0 pin. /phb1 : = 0, enable the internal pull-high of iob1 pin. = 1, disable the internal pull-high of iob1 pin. /phb2 : = 0, enable the internal pull-high of iob2 pin. = 1, disable the internal pull-high of iob2 pin. /phb3 : = 0, enable the internal pull-high of iob3 pin. = 1, disable the internal pull-high of iob3 pin. /phb4 : = 0, enable the internal pull-high of iob4 pin. = 1, disable the internal pull-high of iob4 pin. /phb5 : = 0, enable the internal pull-high of iob5 pin. = 1, disable the internal pull-high of iob5 pin. /phb6 : = 0, enable the internal pull-high of iob6 pin. = 1, disable the internal pull-high of iob6 pin. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
/phb7 : = 0, enable the internal pull-high of iob7 pin. = 1, disable the internal pull-high of iob7 pin. 2.1.13 inten (interrupt mask register) address name b7 b6 b5 b4 b3 b2 b1 b0 0eh (r/w) inten gie - - - - intie pbie t0ie t0ie : timer0 overflow interrupt enable bit. = 0, disable the timer0 overflow interrupt. = 1, enable the timer0 overflow interrupt. pbie : port b input change interrupt enable bit. = 0, disable the port b input change interrupt. = 1, enable the port b input change interrupt . intie : external int pin interrupt enable bit. = 0, disable the external int pin interrupt. = 1, enable the external int pin interrupt. bit6:bit3 : not used. read as ?0?s. gie : global interrupt enable bit. = 0, disable all interrupts. for wake-up from sleep mode through an interrupt event, the device will continue execution at the instruction after the sleep instruction. = 1, enable all un-masked interrupts. for wake-up from sleep mode through an interrupt event, the device will branch to the interrupt address (008h). note : when an interrupt event occur with the gie bit and its corresponding interrupt enable bit are all set, the gie bit will be cleared by hardware to disable any further interrupts. the retfie instruction will exit the interrupt routine and set the gie bit to re-enable interrupt. 2.1.14 intflag (interrupt status register) address name b7 b6 b5 b4 b3 b2 b1 b0 0fh (r/w) intflag - - - - - intif pbif t0if t0if : timer0 overflow interrupt flag. set when timer0 overflows, reset by software. pbif : port b input change interrupt flag. set when port b input changes, reset by software. intif : external int pin interrupt flag. set by rising/falling (selected by intedg bit (option<6>)) edge on int pin, reset by software. bit7:bit3 : not used. read as ?0?s. 2.1.15 acc (accumulator) address name b7 b6 b5 b4 b3 b2 b1 b0 n/a (r/w) acc accumulator accumulator is an internal data transfer, or instruction operand holding. it can not be addressed. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.1.16 option register address name b7 b6 b5 b4 b3 b2 b1 b0 n/a (w) option - intedg t0cs t0se psa ps2 ps1 ps0 by executing the option instruction, the contents of the acc register will be transferred to the option register. the option register is a 7-bit wide, write-only register which contains various control bits to configure the timer0/wdt prescaler, timer0, and the external int interrupt. the option register are ?write-only? and are set all ?1?s except intedg bit. ps2:ps0 : prescaler rate select bits. ps2:ps0 timer0 rate wdt rate 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 1:256 1:1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 psa : prescaler assign bit. = 1, wdt (watch-dog timer). = 0, tmr0 (timer0). t0se : tmr0 source edge select bit. = 1, falling edge on t0cki pin. = 0, rising edge on t0cki pin. t0cs : tmr0 clock source select bit. = 1, external t0cki pin. = 0, internal instruction clock cycle. intedg : interrupt edge select bit. = 1, interrupt on rising edge of int pin. = 0, interrupt on falling edge of int pin. bit7 : not used. 2.1.17 iosta, iostb & iostc (port i/o control registers) address name b7 b6 b5 b4 b3 b2 b1 b0 n/a (w) iosta port a i/o control register n/a (w) iostb port b i/o control register n/a (w) iostc port c i/o control register the port i/o control registers are loaded with the contents of the acc register by executing the iost r (05h~07h) instruction. a ?1? from a iost register bit puts the corresponding output driver in hi-impedance state (input mode). a ?0? enables the output buffer and puts the contents of the output data latch on the selected pins (output mode). the iost registers are ?write-only? and are set (output drivers disabled) upon reset. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.2 i/o ports port a, port b and port c are bi-directional tri-state i/o ports. port a is a 4-pin i/o port. port b and port c are 8-pin i/o ports. all i/o pins (ioa<3:0>, iob<7:0> and ioc<7:0>) have data direction control registers (iosta, iostb, iostc) which can configure these pins as output or input. iob<7:0> have its corresponding pull-high control bits (phcon register) to enable the weak internal pull-high. the weak pull-high is automatically turned off when the pin is configured as an output pin. ioa<3:0> and iob<3:0> have its corresponding pull-down control bits (pdcon register) to enable the weak internal pull-down. the weak pull-down is automatically turned off when the pin is configured as an output pin. iob<7:0> have its corresponding open-drain control bits (odcon register) to enable the open-drain output when these pins are configured to be an output pin. ioa0 and ioa1 are the r-option pins enabled by setting the roc bit (pcon<4>). when the r-option function is used, it is recommended that ioa0 and ioa1 are used as output pins, and read the status of ioa0 and ioa1 before these pins are configured to be an output pin. iob<7:0> also provides the input change interrupt/wake-up function. each pin has its corresponding input change interrupt/wake-up enable bits (wucon) to select the input change interrupt/wake-up source. the iob0 is also an external interrupt input signal by setting the eis bit (pcon<6>). in this case, iob0 input change interrupt/wake-up function will be disabled by hardware even if it is enabled by software. figure 2.3: block diagram of i/o pins ioa3 ~ ioa0, ioc7 ~ ioc0 : pull-down is not shown in the figure d q iost latch > en q i/o pin d q data latch > en q data bus iost r wr port rd port tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
iob0/int : pull-high/pull-down and open-drain are not shown in the figure iob7 ~ iob1 : pull-high/pull-down and open-drain are not shown in the figure d q iost latch > en q i/o pin d q data latch > en q data bus iost r wr port rd port q d latch q en< set pbif wubn eis eis int intedg d q iost latch > en q i/o pin d q data latch > en q data bus iost r wr port rd port q d latch q en< set pbif wubn tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.3 timer0/wdt & prescler 2.3.1 timer0 the timer0 is a 8-bit timer/counter. the clock source of timer0 can come from the internal clock or by an external clock source (t0cki pin). 2.3.1.1 using timer0 with an internal clock : timer mode timer mode is selected by clearing the t0cs bit (option<5>). in timer mode, the timer0 register (tmr0) will increment every instruction cycle (without prescaler). if tmr0 register is written, the increment is inhibited for the following two cycles. 2.3.1.2 using timer0 with an external clock : counter mode counter mode is selected by setting the t0cs bit (opton<5>). in this mode, timer0 will increment either on every rising or falling edge of pin t0ckl. the incrementing edge is determined by the source edge select the rising edge. the external clock requirement is due to internal phase clock (tosc) synchronization. also, there is a delay in the actual incrementing of timer0 after synchronization. when no prescaler is used, the external clock input is the same as the prescaler output. the synchronization of t0cki with the internal phase clocks is accomplished by sampling the prescaler output on the t2 and t4 cycles of the internal phase clocks. therefore, it is necessary for t0cki to be high for at least 2 t osc and low for at least 2 tosc. when a prescaler is used, the external clock input is divided by the asynchronous prescaler. for the external clock to meet the sampling requirement, the ripple counter must be taken into account. therefore, it is necessary for t0cki to have a period of at least 4tosc divided by the prescaler value. 2.3.2 watchdog timer (wdt) the watchdog timer (wdt) is a free running on-chip rc oscillator which does not require any external components. so the wdt will still run even if the clock on the osci and osco pins is turned off, such as in sleep mode. during normal operation or in sleep mode, a wdt time-out will cause the device reset and the to bit (status<4>) will be cleared. the wdt can be disabled by clearing the control bit wdte (pcon<7>) to ?0?. the wdt has a nominal time-out period of 18 ms (without prescaler). if a longer time-out period is desired, a prescaler with a division ratio of up to 1:128 can be assigned to the wdt controlled by the option register. thus, the longest time-out period is approxmately 2.3 seconds. the clrwdt instruction clears the wdt and the prescaler, if assigned to the wdt, and prevents it from timing out and generating a device reset. the sleep instruction resets the wdt and the prescaler, if assigned to the wdt. this gives the maximum sleep time before a wdt wake-up reset. 2.3.3 prescaler an 8-bit counter (down counter) is available as a prescaler for the timer0, or as a postscaler for the watchdog timer (wdt). note that the prescaler may be used by either the timer0 module or the wdt, but not both. thus, a prescaler assignment for the timer0 means that there is no prescaler for the wdt, and vice-versa. the psa bit (option<3>) determines prescaler assignment. the ps<2:0> bits (option<2:0>) determine prescaler ratio. when the prescaler is assigned to the timer0 module, all instructions writing to the tmr0 register will clear the prescaler. when it is assigned to wdt, a clrwdt instruction will clear the prescaler along with the wdt. the prescaler is neither readable nor writable. on a reset, the prescaler contains all ?1?s. to avoid an unintended device reset, clrwdt or clrr tmr0 instructions must be executed when changing the prescaler assignment from timer0 to the wdt, and vice-versa. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
figure 2.4: block diagram of the timer0/wdt prescaler 2.4 interrupts the TLC156 series has up to three sources of interrupt: 1. external interrupt int pin. 2. tmr0 overflow interrupt. 3. port b input change interrupt (pins iob7:iob0). intflag is the interrupt flag register that recodes the interrupt requests in the relative flags. a global interrupt enable bit, gie (inten<7>), enables (if set) all un-masked interrupts or disables (if cleared) all interrupts. individual interrupts can be enabled/disabled through their corresponding enable bits in inten register regardless of the status of the gie bit. when an interrupt event occur with the gie bit and its corresponding interrupt enable bit are all set, the gie bit will be cleared by hardware to disable any further interrupts, and the next instruction will be fetched from address 008h. the interrupt flag bits must be cleared by software before re-enabling gie bit to avoid recursive interrupts. the retfie instruction exits the interrupt routine and set the gie bit to re-enable interrupt. the flag bit (except pbif bit) in intflag register is set by interrupt event regardless of the status of its mask bit. reading the intflag register will be the logic and of intflag and inten. when an interrupt is generated by the int instruction, the next instruction will be fetched from address 002h. 2.4.1 external int interrupt external interrupt on int pin is rising or falling edge triggered selected by intedg (option<6>). when a valid edge appears on the int pin the flag bit intif (intflag<2>) is set. this interrupt can be disabled by clearing intie bit (inten<2>). the int pin interrupt can wake-up the system from sleep condition, if bit intie was set before going to sleep. if gie bit was set, the program will execute interrupt service routine after wake-up; or if gie bit was cleared, the program will execute next pc after wake-up. 2.4.2 timer0 interrupt an overflow (ffh 00h) in the tmr0 register will set the flag bit t0if (intflag<0>). this interrupt can be disabled by clearing t0ie bit (inten<0>). t0cki t0se t0cs mux 0 1 mux 0 1 watchdog timer psa 8-bit prescaler ps2:ps0 wdt time-out mux 1 0 psa mux 1 0 psa sync 2 cycles instruction cycle (fosc/4 or fosc/2 or fosc/8) tmr0 register data bus 8 set t0if flag on overflow tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.4.3 port b input change interrupt an input change on iob<7:0> set flag bit pbif (intflag<1>). this interrupt can be disabled by clearing pbie bit (inten<1>). before the port b input change interrupt is enabled, reading portb (any instruction accessed to portb, including read/write instructions) is necessary. any pin which corresponding wubn bit (wucon<7:0>) is cleared to ?0? or configured as output or iob0 pin configured as int pin will be excluded from this function. the port b input change interrupt also can wake-up the system from sleep condition, if bit pbie was set before going to sleep. and gie bit also decides whether or not the processor branches to the interrupt vector following wake-up. if gie bit was set, the program will execute interrupt service routine after wake-up; or if gie bit was cleared, the program will execute next pc after wake-up. 2.5 power-down mode (sleep) power-down mode is entered by executing a sleep instruction. when sleep instruction is executed, the pd bit (status<3>) is cleared, the to bit is set, the watchdog timer will be cleared and keeps running, and the oscillator driver is turned off. all i/o pins maintain the status they had before the sleep instruction was executed. 2.5.1 wake-up from sleep mode the device can wake-up from sleep mode through one of the following events: 1. rstb reset. 2. wdt time-out reset (if enabled). 3. interrupt from rb0/int pin, or portb change interrupt. external rstb reset and wdt time-out reset will cause a device reset. the pd and to bits can be used to determine the cause of device reset. the pd bit is set on power-up and is cleared when sleep instruction is executed. the to bit is cleared if a wdt time-out occurred. for the device to wake-up through an interrupt event, the corresponding interrupt enable bit must be set. wake-up is regardless of the gie bit. if gie bit is cleared, the device will continue execution at the instruction after the sleep instruction. if the gie bit is set, the device will branch to the interrupt address (008h). the system wake-up delay time is 18ms plus 128 oscillator cycle time. 2.6 reset TLC156 devices may be reset in one of the following ways: 1. power-on reset (por) 2. brown-out reset (bor) 3. rstb pin reset 4. wdt time-out reset some registers are not affected in any reset condition. their status is unknown on power-on reset and unchanged in any other reset. most other registers are reset to a ?reset state? on power-on reset, rstb or wdt reset. a power-on reset pulse is generated on-chip when vdd rise is detected. to use this feature, the user merely ties the rstb pin to vdd. on-chip low voltage detector (lvd) places the device into reset when vdd is below a fixed voltage. this ensures that the device does not continue program execution outside the valid operation vdd range. brown-out reset is typically used in ac line or heavy loads switched applications. a rstb or wdt wake-up from sleep also results in a device reset, and not a continuation of operation before sleep. the to and pd bits (status<4:3>) are set or cleared depending on the different reset conditions. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.6.1 power-up reset timer(pwrt) the power-up reset timer provides a nominal 18ms delay after power-on reset (por), brown-out reset (bor), rstb reset or wdt time-out reset. the device is kept in reset state as long as the pwrt is active. the pwdt delay will vary from device to device due to vdd, temperature, and process variation. 2.6.2 oscillator start-up timer(ost) the ost timer provides a 128 oscillator cycle delay (from osci input) after the pwrt delay (18ms) is over. this delay ensures that the x?tal oscillator or resonator has started and stabilized. the device is kept in reset state as long as the ost is active. this counter only starts incrementing after the amplitude of the osci signal reaches the oscillator input thresholds. 2.6.3 reset sequence when power-on reset (por), brown-out reset (bor), rstb reset or wdt time-out reset is detected, the reset sequence is as follows: 1. the reset latch is set and the pwrt & ost are cleared. 2. when the internal por, bor, rstb reset or wdt time-out reset pulse is finished, then the pwrt begins counting. 3. after the pwrt time-out, the ost is activated. 4. and after the ost delay is over, the reset latch will be cleared and thus end the on-chip reset signal. the totally system reset delay time is 18ms plus 128 oscillator cycle time. figure 2.5: simplified block diagram of on-chip reset circuit low voltage detector (lvd) vdd on-chip rc osc s q reset latch r q reset chip por reset power-up reset timer (pwrt) reset oscillator start-up timer (ost) wdt time-out wdt module osci power-on reset (por) bor rstb tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
table 2.1: reset conditions for all registers register address power-on reset brown-out reset rstb reset wdt reset acc n/a xxxx xxxx uuuu uuuu option n/a -011 1111 -011 1111 iosta n/a ---- 1111 ---- 1111 iostb n/a 1111 1111 1111 1111 iostc n/a 1111 1111 1111 1111 indf 00h xxxx xxxx uuuu uuuu tmr0 01h xxxx xxxx uuuu uuuu pcl 02h 1111 1111 1111 1111 status 03h 0001 1xxx 000# #uuu fsr 04h xxxx xxxx uuuu uuuu porta 05h ---- xxxx ---- uuuu portb 06h xxxx xxxx uuuu uuuu portc 07h xxxx xxxx uuuu uuuu pcon 08h 1010 ---- 1010 ---- wucon 09h 0000 0000 0000 0000 pchbuf 0ah ---- -000 ---- -000 pdcon 0bh 1111 1111 1111 1111 odcon 0ch 0000 0000 0000 0000 phcon 0dh 1111 1111 1111 1111 inten 0eh 0--- -000 0--- -000 intflag 0fh ---- -000 ---- -000 general purpose registers 10 ~ 3fh xxxx xxxx uuuu uuuu legend: u = unchanged, x = unknown, - = unimplemented, # = refer to the following table for possible values. table 2.2: to / pd status after reset to pd reset was caused by 1 1 power-on reset 1 1 brown-out reset u u rstb reset during normal operation 1 0 rstb reset during sleep 0 1 wdt reset during normal operation 0 0 wdt reset during sleep legend: u = unchanged table 2.3: events affecting to / pd status bits event to pd power-on 1 1 wdt time-out 0 u sleep instruction 1 0 clrwdt instruction 1 1 legend: u = unchanged p tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.7 hexadecimal convert to decimal (hcd) decimal format is another number format for TLC156. when the content of the data memory has been assigned as decimal format, it is necessary to convert the results to decimal format after the execution of alu instructions. when the decimal converting operation is processing, all of the operand data (including the contents of the data memory (ram), accumulator (acc), immediate data, and look-up table) should be in the decimal format, or the results of conversion will be incorrect. instruction daa can convert the acc data from hexadecimal to decimal format after any addition operation and restored to acc. the conversion operation is illustrated in example 2.2. example 2.2: daa conversion movia 90h ;set immediate data = decimal format number ?90? (acc ? 90h) movar 30h ;load immediate data ?90? to data memory address 30h movia 10h ;set immediate data = decimal format number ?10? (acc ? 10h) addar 30h, 0 ;contents of the data memory address 30h and acc are binary-added ;the result loads to the acc (acc ? a0h, c ? 0) daa ;convert the content of acc to decimal format, and restored to acc ;the result in the acc is ?00? and the carry bit c is ?1?. this represents the ;decimal number ?100? instruction das can convert the acc data from hexadecimal to decimal format after any subtraction operation and restored to acc. the conversion operation is illustrated in example 2.3. example 2.3: das conversion movia 10h ;set immediate data = decimal format number ?10? (acc ? 10h) movar 30h ;load immediate data ?10? to data memory address 30h movia 20h ;set immediate data = decimal format number ?20? (acc ? 20h) subar 30h, 0 ;contents of the data memory address 30h and acc are binary-subtracted ;the result loads to the acc (acc ? f0h, c ? 0) das ;convert the content of acc to decimal format, and restored to acc ;the result in the acc is ?90? and the carry bit c is ?0?. this represents the ;decimal number ? -10? 2.8 oscillator configurations TLC156 can be operated in four different oscillator modes. users can program two configuration bits (fosc<1:0>) to select the appropriate modes: lf: low frequency crystal oscillator xt: crystal/resonator oscillator hf: high frequency crystal/resonator oscillator rc: resistor/capacitor oscillator in lf, xt, or hf modes, a crystal or ceramic resonator in connected to the osci and osco pins to establish oscillation. when in lf, xt, or hf modes, the devices can have an external clock source drive the osci pin. the rc device option offers additional cost savings for timing insensitive applications. the rc oscillator frequency is a function of the supply voltage, the resistor (rext) and capacitor (cext), the operating temperature, and the process parameter. tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
figure 2.6: hf, xt or lf oscillator modes (crystal operation or ceramic resonator) figure 2.7: hf, xt or lf oscillator modes (external clock input operation) figure 2.8: rc oscillator mode TLC156 osci osco sleep internal circuit rs x?tal c1 c2 rf TLC156 osci osco open clock from external system TLC156 osci osco rext internal circuit /2, /4, /8 cext tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
2.9 configurations word table 2.4: configurations word bit name description 1, 0 fosc<1:0> oscillator selection bits = 1, 1 rc mode (default) = 1, 0 hf mode = 0, 1 xt mode = 0, 0 lf mode 2 wdten watchdog timer enable bit = 1, wdt enabled (default) = 0, wdt disabled 3 protect code protection bit = 1, eprom code protection off (default) = 0, eprom code protection on 5, 4 lvdt<1:0> low voltage detector selection bit = 1, 1 disable (default) = 0, 1 enable, lvdt voltage = 2.0v = 0, 0 enable, lvdt voltage = 3.6v 7, 6 oscd<1:0> instruction period selection bits = 1, 1 four oscillator periods (default) = 1, 0 two oscillator periods = 0, 0 eight oscillator periods 9, 8 pmod<1:0> power mode selection bits = 1, 1 power mode 3, non-power saving (default) = 1, 0 power mode 2, power saving = 0, 1 power mode 1, power saving = 0, 0 power mode 0, power saving 12, 11, 10 - unused tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
3.0 instruction set mnemonic, operands description operation cycles status affected bcr r, bit clear bit in r 0 r 1 - bsr r, bit set bit in r 1 r 1 - btrsc r, bit test bit in r, skip if clear skip if r = 0 1/2 (1) - btrss r, bit test bit in r, skip if set skip if r = 1 1/2 (1) - nop no operation no operation 1 - clrwdt clear watchdog timer 00h wdt, 00h wdt prescaler 1 to , pd option load option register acc option 1 - sleep go into power-down mode 00h wdt, 00h wdt prescaler 1 to , pd int s/w interrupt pc + 1 top of stack, 002h pc 3/2 (2) - daa adjust acc?s data format from hex to dec after any addition operation acc(hex) acc(dec) 1 c das adjust acc?s data format from hex to dec after any subtraction operation acc(hex) acc(dec) 1 - return return from subroutine top of stack pc 2 - retfie return from interrupt, set gie bit top of stack pc, 1 gie 2 - clra clear acc 00h acc 1 z iost r load iost register acc iost register 1 - clrr r clear r 00h r 1 z movar r move acc to r acc r 1 - movr r, d move r r dest 1 z decr r, d decrement r r - 1 dest 1 z decrsz r, d decrement r, skip if 0 r - 1 dest, skip if result = 0 1/2 (1) - incr r, d increment r r + 1 dest 1 z incrsz r, d increment r, skip if 0 r + 1 dest, skip if result = 0 1/2 (1) - addar r, d add acc and r r + acc dest 1 c, dc, z subar r, d subtract acc from r r - acc dest 1 c, dc, z adcar r, d add acc and r with carry r + acc + c dest 1 c, dc, z sbcar r, d subtract acc from r with carry r + acc + c dest 1 c, dc, z andar r, d and acc with r acc and r dest 1 z iorar r, d inclusive or acc with r acc or r dest 1 z xorar r, d exclusive or acc with r r xor acc dest 1 z comr r, d complement r r dest 1 z rlr r, d rotate left f through carry r<7> c, r<6:0> dest<7:1>, c dest<0> 1 c tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
rrr r, d rotate right f through carry c dest<7>, r<7:1> dest<6:0>, r<0> c 1 c swapr r, d swap r r<3:0> dest<7:4>, r<7:4> dest<3:0> 1 - movia i move immediate to acc i acc 1 - addia i add acc and immediate i + acc acc 1 c, dc, z subia i subtract acc from immediate i - acc acc 1 c, dc, z andia i and immediate with acc acc and i acc 1 z ioria i or immediate with acc acc or i acc 1 z xoria i exclusive or immediate to acc acc xor i acc 1 z retia i return, place immediate in acc i acc, top of stack pc 2 - call i call subroutine pc + 1 top of stack, i pc<9:0> pchbuf<2> pc<10> 2 - goto i unconditional branch i pc<9:0> pchbuf<2> pc<10> 2 - note: 1. 2 cycles for skip, else 1 cycle 2. 3 cycles for tlc154/156 2 cycles for tlc155/157 3. bit : bit address within an 8-bit register r r : register address (00h to 3fh) i : immediate data acc : accumulator d : destination select; =0 (store result in acc) =1 (store result in file register r) dest : destination pc : program counter pchbuf : high byte buffer of program counter wdt : watchdog timer counter gie : global interrupt enable bit to : time-out bit pd : power-down bit c : carry bit dc : digital carry bit z : zero bit tlc tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
adcar add acc and r with carry syntax: adcar r, d operands: 0 r 63 d ? [0,1] operation: r + acc + c dest status affected: c, dc, z description: add the contents of the acc register and register ?r? with carry. if ?d? is 0 the result is stored in the acc register. if ?d? is ?1? the result is stored back in register ?r?. cycles: 1 addar add acc and r syntax: addar r, d operands: 0 r 63 d ? [0,1] operation: acc + r dest status affected: c, dc, z description: add the contents of the acc register and register ?r?. if ?d? is 0 the result is stored in the acc register. if ?d? is ?1? the result is stored back in register ?r?. cycles: 1 addia add acc and immediate syntax: addia i operands: 0 i 255 operation: acc + i acc status affected: c, dc, z description: add the contents of the acc register with the 8-bit immediate ?i?. the result is placed in the acc register. cycles: 1 andar and acc and r syntax: andar r, d operands: 0 r 63 d ? [0,1] operation: acc and r dest status affected: z description: the contents of the acc register are and?ed with register ?r?. if ?d? is 0 the result is stored in the acc register. if ?d? is ?1? the result is stored back in register ?r?. cycles: 1 andia and immediate with acc syntax: andia i operands: 0 i 255 operation: acc and i acc status affected: z description: the contents of the acc register are and?ed with the 8- bit immediate ?i?. the result is placed in the acc register. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
bcr clear bit in r syntax: bcf r, b operands: 0 r 63 0 b 7 operation: 0 r status affected: none description: clear bit ?b? in register ?r?. cycles: 1 bsr set bit in r syntax: bsr r, b operands: 0 r 63 0 b 7 operation: 1 r status affected: none description: set bit ?b? in register ?r?. cycles: 1 btrsc test bit in r, skip if clear syntax: btrsc r, b operands: 0 r 63 0 b 7 operation: skip if r = 0 status affected: none description: if bit ?b? in register ?r? is 0 then the next instruction is skipped. if bit ?b? is 0 then next instruction fetched during the current instruction execution is discarded, and a nop is executed instead making this a 2-cycle instruction.. cycles: 1(2) btrss test bit in r, skip if set syntax: btrss r, b operands: 0 r 63 0 b 7 operation: skip if r = 1 status affected: none description: if bit ?b? in register ?r? is ?1? then the next instruction is skipped. if bit ?b? is ?1?, then the next instruction fetched during the current instruction execution, is discarded and a nop is executed instead, making this a 2-cycle instruction. cycles: 1(2) call subroutine call syntax: call i operands: 0 i 1023 operation: pc +1 top of stack; i pc<9:0> pchbuf<2> pc<10> status affected: none description: subroutine call. first, return address (pc+1) is pushed onto the stack. the 10- bit immediate address is loaded into pc bits <10:0>. call is a two-cycle instruction. cycles: 2 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
clra clear acc syntax: clra operands: none operation: 00h acc; 1 z status affected: z description: the acc register is cleared. zero bit (z) is set. cycles: 1 clrr clear r syntax: clrr r operands: 0 r 63 operation: 00h r; 1 z status affected: z description: the contents of register ?r? are cleared and the z bit is set. cycles: 1 clrwdt clear watchdog timer syntax: clrwdt operands: none operation: 00h wdt; 00h wdt prescaler (if assigned); 1 to ; 1 pd status affected: to , pd description: the clrwdt instruction resets the wdt. it also resets the prescaler, if the prescaler is assigned to the wdt and not timer0. status bits to and pd are set. cycles: 1 comr complement r syntax: comr r, d operands: 0 r 63 d ? [0,1] operation: r dest status affected: z description: the contents of register ?r? are complemented. if ?d? is 0 the result is stored in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 daa adjust acc?s data format from hex to dec syntax: daa operands: none operation: acc(hex) acc(dec) status affected: c description: convert the acc data from hexadecimal to decimal format after any addition operation and restored to acc. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
das adjust acc?s data format from hex to dec syntax: das operands: none operation: acc(hex) acc(dec) status affected: none description: convert the acc data from hexadecimal to decimal format after any subtraction operation and restored to acc. cycles: 1 decr decrement r syntax: decr r, d operands: 0 r 63 d ? [0,1] operation: r - 1 dest status affected: z description: decrement register ?r?. if ?d? is 0 the result is stored in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 decrsz decrement r, skip if 0 syntax: decrsz r, d operands: 0 r 63 d ? [0,1] operation: r - 1 dest; skip if result =0 status affected: none description: the contents of register ?r? are decremented. if ?d? is 0 the result is placed in the acc register. if ?d? is 1 the result is placed back in register ?r?. if the result is 0, the next instruction, which is already fetched, is discarded and a nop is executed instead making it a two-cycle instruction. cycles: 1(2) goto unconditional branch syntax: goto i operands: 0 i 1023 operation: i pc<9:0> pchbuf<2> pc<10> status affected: none description: goto is an unconditional branch. the 10- bit immediate value is loaded into pc bits <9:0>. goto is a two-cycle instruction. cycles: 2 incr increment r syntax: incr r, d operands: 0 r 63 d ? [0,1] operation: r + 1 dest status affected: z description: the contents of register ?r? are incremented. if ?d? is 0 the result is placed in the acc register. if ?d? is 1 the result is placed back in register ?r?. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
incrsz increment r, skip if 0 syntax: incrsz r, d operands: 0 r 63 d ? [0,1] operation: r + 1 dest, skip if result = 0 status affected: none description: the contents of register ?r? are incremented. if ?d? is 0 the result is placed in the acc register. if ?d? is the result is placed back in register ?r?. if the result is 0, then the next instruction, which is already fetched, is discarded and a no p is executed instead making it a two-cycle instruction. cycles: 1(2) int s/w interrupt syntax: int operands: none operation: pc + 1 top of stack, 002h pc status affected: none description: interrupt subroutine call. first, return address (pc+ 1) is pushed onto the stack. the address 002h is loaded into pc bits <10:0>. cycles: 2 for tlc155/157; 3 for tlc154/156 iorar or acc with r syntax: iorar r, d operands: 0 r 63 d ? [0,1] operation: acc or r dest status affected: z description: inclusive or the acc register with register ?r?. if ?d? is 0 the result is placed in the acc register. if ?d? is 1 the result is placed back in register ?r?. cycles: 1 ioria or immediate with acc syntax: ioria i operands: 0 i 255 operation: acc or i acc status affected: z description: the contents of the acc register are or?ed with the 8-bit immediate ?i?. the result is plac ed in the acc register. cycles: 1 iost load iost register syntax: iost r operands: r = 5,6 or 7 operation: acc iost register r status affected: none description: iost register ?r? (r= 5,6 or7) is loaded with the contents of the acc register. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
movar move acc to r syntax: movar r operands: 0 r 63 operation: acc r status affected: none description: move data from the acc register to register ?r?. cycles: 1 movia move immediate to acc syntax: movia i operands: 0 i 255 operation: i acc status affected: none description: the 8-bit immediate ?i? is loaded into the acc register. the don?t cares will assemble as 0s. cycles: 1 movr move r syntax: movr r, d operands: 0 r 63 d ? [0,1] operation: r dest status affected: z description: the contents of register ?r? is moved to destination ?d?. if ?d? is 0, destination is the acc register. if ?d? is 1, the destination is file register ?r?. ?d? is 1 is useful to test a file register since status flag z is affected. cycles: 1 nop no operation syntax: nop operands: none operation: no operation status affected: none description: no operation. cycles: 1 option load option register syntax: option operands: none operation: acc option status affected: none description: the content of the acc register is loaded into the option register. cycles: 1 retfie return from interrupt, set ?gie? bit syntax: retfie operands: none operation: top of stack pc status affected: none description: the program counter is loaded from the top of the stack (the return address). the ?gie? bit is set to 1. this is a two-cycle instruction. cycles: 2 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
retia return with immediate in acc syntax: retia i operands: 0 i 255 operation: i acc; top of stack pc status affected: none description: the acc register is loaded with the 8- bit immediate ?i?. the program counter is loaded from the top of the stack (the return address). this is a two-cycle instruction. cycles: 2 return return from subroutine syntax: return operands: none operation: top of stack pc status affected: none description: the program counter is loaded from the top of the stack (the return address). this is a two-cycle instruction. cycles: 2 rlr rotate left f through carry syntax: rlr r, d operands: 0 r 63 d ? [0,1] operation: r<7> c; r<6:0> dest<7:1>; c dest<0> status affected: c description: the contents of register ?r? are rotated one bit to the left through the carry flag. if ?d? is 0 the result is placed in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 rrr rotate right f through carry syntax: rrr r, d operands: 0 r 63 d ? [0,1] operation: c dest<7>; r<7:1> dest<6:0>; r<0> c status affected: c description: the contents of register ?r? are rotated one bit to the right through the carry flag. if ?d? is 0 the result is placed in the acc register. if ?d? is 1 the result is placed back in register ?r?. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
sleep enter sleep mode syntax: sleep operands: none operation: 00h wdt; 00h wdt prescaler; 1 to ; 0 pd status affected: to , pd description: time-out status bit ( to ) is set. the power-down status bit ( pd ) is cleared. the wdt and its prescaler are cleared. the processor is put into sleep mode. cycles: 1 sbcar subtract acc from r with carry syntax: sbcar r, d operands: 0 r 63 d ? [0,1] operation: r + acc + c dest status affected: c, dc, z description: add the 2?s complement method of the acc register from register ?r? with carry. i f ?d? is 0 the result is stored in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 subar subtract acc from r syntax: subar r, d operands: 0 r 63 d ? [0,1] operation: r - acc dest status affected: c, dc, z description: subtract (2?s complement method) the acc register from register ?r?. if ?d? is 0 the result is stored in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 subia subtract acc from immediate syntax: subar r, d operands: 0 i 255 operation: i - acc acc status affected: c, dc, z description: subtract (2?s complement method) the acc register from the 8- bit immediate ?i?. the result is placed in the acc register. cycles: 1 swapr swap nibbles in r syntax: swapr r, d operands: 0 r 63 d ? [0,1] operation: r<3:0> dest<7:4>; r<7:4> dest<3:0> status affected: none description: the upper and lower nibbles of register ?r? are exchanged. if ?d? is 0 the result is placed in acc register. if ?d? is 1 the result in placed in register ?r?. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
xorar exclusive or acc with r syntax: xorar r, d operands: 0 r 63 d ? [0,1] operation: acc xor r dest status affected: z description: exclusive or the contents of the acc register with register ?r?. if ?d? is 0 the res ult is stored in the acc register. if ?d? is 1 the result is stored back in register ?r?. cycles: 1 xoria exclusive or immediate with acc syntax: xoria i operands: 0 i 255 operation: acc xor i acc status affected: z description: the contents of the acc register are xor?ed with the 8- bit immediate ?i?. the result is placed in the acc register. cycles: 1 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
4.0 absolute maximum ratings ambient operating temperature 0 ?? ? ?? ?? ? ??????? ???????????? ? ? ???? ? ?????? ?? ?? ? ? ? ? ? ? ???? ??
6.0 electrical characteristics 6.1 electrical characteristics of tlc154/156 under operating conditions, at four clock instruction cycles and wdt & lvdt are disabled sym description conditions min. typ. max. unit hf mode, vdd=5v 1 20 f hf x?tal oscillation range hf mode, vdd=3v 1 15 mhz xt mode, vdd=5v 0.5 10 f xt x?tal oscillation range xt mode, vdd=3v 0.5 10 mhz lf mode, vdd=5v 32 4000 f lf x?tal oscillation range lf mode, vdd=3v 32 1000 khz rc mode, vdd=5v dc 15 f rc rc oscillation range rc mode, vdd=3v dc 7 mhz i/o ports, vdd=5v 2.0 rstb, t0cki pins, vdd=5v 4.0 i/o ports, vdd=3v 1.5 v ih input high voltage rstb, t0cki pins, vdd=3v 2.4 v i/o ports, vdd=5v 1.0 rstb, t0cki pins, vdd=5v 1.0 i/o ports, vdd=3v 0.6 v il input low voltage rstb, t0cki pins, vdd=3v 0.6 v v oh output high voltage i oh =-5.4ma, vdd=5v 3.6 v v ol output low voltage i ol =8.7ma, vdd=5v 0.6 v i ph pull-high current input pin at vss, vdd=5v -45 ua i pd pull-down current input pin at vdd, vdd=5v 35 ua vdd=5v 9 12 i wdt wdt current vdd=3v 2 4 ua vdd=3v 20.4 vdd=4v 17.9 t wdt wdt period vdd=5v 16.2 ms vdd=5v lvdt = 3.6v 30 40 vdd=5v lvdt = 2v 23 30 i lvdt lvdt current vdd=3v lvdt = 2v 6.8 8.0 ua sleep mode, vdd=5v, wdt enable 20 sleep mode, vdd=5v, wdt disable 3 sleep mode, vdd=3v, wdt enable 2.5 i sb power down current sleep mode, vdd=3v, wdt disable 1.1 ua hf mode, vdd=5v, 4 clock instruction 20mhz 2.04 15mhz 1.68 10mhz 1.28 4mhz 0.78 i dd operating current 2mhz 0.62 ma tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
hf mode, vdd=3v, 4 clock instruction 20mhz 0.92 15mhz 0.72 10mhz 0.54 4mhz 0.30 i dd operating current 2mhz 0.19 ma hf mode, vdd=5v, 2 clock instruction 20mhz 2.94 15mhz 2.34 10mhz 1.74 4mhz 0.96 i dd operating current 2mhz 0.68 ma hf mode, vdd=3v, 2 clock instruction 20mhz 1.38 15mhz 1.07 10mhz 0.77 4mhz 0.38 i dd operating current 2mhz 0.24 ma xt mode, vdd=5v, 4 clock instruction 20mhz 1.69 15mhz 1.36 10mhz 1.04 4mhz 0.64 i dd operating current 2mhz 0.49 ma xt mode, vdd=3v, 4 clock instruction 20mhz 0.78 15mhz 0.60 10mhz 0.44 4mhz 0.24 i dd operating current 2mhz 0.17 ma xt mode, vdd=5v, 2 clock instruction 20mhz 2.81 15mhz 2.20 10mhz 1.60 4mhz 0.87 i dd operating current 2mhz 0.61 ma xt mode, vdd=3v, 2 clock instruction 20mhz 1.36 15mhz 1.05 10mhz 0.73 4mhz 0.36 i dd operating current 2mhz 0.23 ma tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
lf mode, vdd=5v, 4 clock instruction 2mhz 290 1mhz 208 500khz 167 100khz 118 i dd operating current 32khz 101 ua lf mode, vdd=3v, 4 clock instruction 2mhz 105 1mhz 73 500khz 54 100khz 33 i dd operating current 32khz 26 ua lf mode, vdd=5v, 2 clock instruction 2mhz 371 1mhz 269 500khz 194 100khz 130 i dd operating current 32khz 108 ua lf mode, vdd=3v, 2 clock instruction 2mhz 158 1mhz 100 500khz 67 100khz 38 i dd operating current 32khz 29 ua rc mode, vdd=5v, 4 clock instruction r=1kohm f=14.96mhz 4.572 r=3.3kohm f=11.06mhz 1.845 r=10kohm f=5.80mhz 0.761 r=100kohm f=808khz 0.170 c=3p r=300kohm f=276khz 0.119 r=1kohm f=11.7mhz 4.226 r=3.3kohm f=6.35mhz 1.519 r=10kohm f=2.73mhz 0.613 r=100kohm f=320khz 0.147 c=20p r=300kohm f=108khz 0.109 r=1kohm f=5.23mhz 3.429 r=3.3kohm f=2.05mhz 1.163 r=10kohm f=748khz 0.454 r=100kohm f=80khz 0.126 c=100p r=300kohm f=26.4khz 0.100 i dd operating current c=300p r=1kohm f=2.5mhz 3.024 ma tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
r=3.3kohm f=900khz 1.021 r=10kohm f=316khz 0.403 r=100kohm f=32khz 0.119 r=300kohm f=10.67khz 0.098 rc mode, vdd=3v, 4 clock instruction r=1kohm f=8.29mhz 2.280 r=3.3kohm f=7.2mhz 0.913 r=10kohm f=4.58mhz 0.396 r=100kohm f=900khz 0.071 c=3p r=300kohm f=316khz 0.040 r=1kohm f=7mhz 2.214 r=3.3kohm f=5.1mhz 0.837 r=10kohm f=2.71mhz 0.327 r=100kohm f=374khz 0.058 c=20p r=300kohm f=128khz 0.035 r=1kohm f=4.14mhz 2.060 r=3.3kohm f=2.11mhz 0.688 r=10kohm f=848khz 0.253 r=100kohm f=96khz 0.047 c=100p r=300kohm f=32khz 0.030 r=1kohm f=2.36mhz 1.890 r=3.3kohm f=972khz 0.630 r=10kohm f=360khz 0.226 r=100kohm f=38khz 0.043 i dd operating current c=300p r=300kohm f=12.71khz 0.028 ma rc mode, vdd=5v, 2 clock instruction r=1kohm f=15.16mhz 5.435 r=3.3kohm f=11.27mhz 2.358 r=10kohm f=5.77mhz 986 r=100kohm f=826khz 0.183 c=3p r=300kohm f=274khz 0.108 r=1kohm f=11.56mhz 4.835 r=3.3kohm f=6.12mhz 1.808 r=10kohm f=2.72mhz 0.701 r=100kohm f=308khz 0.138 c=20p r=300kohm f=105khz 0.092 r=1kohm f=5.32mhz 3.680 r=3.3kohm f=1.99mhz 1.234 r=10kohm f=722khz 0.479 r=100kohm f=77khz 0.110 c=100p r=300kohm f=25.0khz 0.081 r=1kohm f=2.52mhz 3.107 r=3.3kohm f=892khz 1.057 r=10kohm f=312khz 0.398 r=100kohm f=32khz 0.102 i dd operating current c=300p r=300kohm f=11khz 0.077 ma tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
rc mode, vdd=3v, 2 clock instruction r=1kohm f=8.306mhz 2.552 r=3.3kohm f=7.29mhz 1.130 r=10kohm f=4.81mhz 0.518 r=100kohm f=904khz 0.084 c=3p r=300kohm f=338khz 0.039 r=1kohm f=7.08mhz 2.445 r=3.3kohm f=5.07mhz 0.986 r=10kohm f=2.68mhz 0.393 r=100kohm f=362khz 0.061 c=20p r=300kohm f=123khz 0.031 r=1kohm f=4.11mhz 2.197 r=3.3kohm f=2.03mhz 0.745 r=10kohm f=810khz 0.270 r=100kohm f=91khz 0.043 c=100p r=300kohm f=30khz 0.025 r=1kohm f=2.37mhz 1.953 r=3.3kohm f=964khz 0.648 r=10kohm f=354khz 0.231 r=100kohm f=38khz 0.038 i dd operating current c=300p r=300kohm f=13khz 0.022 ma 6.2 electrical characteristics of tlc155/157 to be defined 6.3 electrical characteristics of tlc154/156 to be defined 6.4 electrical characteristics of tlc155/157 to be defined tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
7.0 package dimension 7.1 18-pin pdip 300mil 0.727 e 1 d top e-pin indent 0.079 bottom e-pin indent 0.118 e 1 5 o ( 4 x ) c e b a l b1 a 2 b d1 a 1 e dimension in millimeters dimension in inches symbols min nom max min nom max a - - 4.57 - - 0.180 a1 0.13 - - 0.005 - - a2 - 3.30 3.56 - 0.130 0.140 b 0.36 0.46 0.56 0.014 0.018 0.022 b1 1.27 1.52 1.78 0.050 0.060 0.070 c 0.20 0.25 0.33 0.008 0.010 0.013 d 22.71 22.96 23.11 0.894 0.904 0.910 d1 0.43 0.56 0.69 0.017 0.022 0.027 e 7.62 - 8.26 0.300 - 0.325 e1 6.40 6.50 6.65 0.252 0.256 0.262 e - 2.54 - - 0.100 - l 3.18 - - 0.125 - - tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
7.2 18-pin sop 300mil e h d a 2 a e 7 o (4x) b a 1 0 . 0 2 0 x 4 5 o 7 o ( 4 x ) c view
7.3 20-pin ssop 209mil e d b c view
7.4 28-pin pdip 600mil e 1 d a l b a 2 b1 a 1 e e 1 5 o ( 4 x ) e b dimension in millimeters dimension in inches symbols min nom max min nom max a - - 5.59 - - 0.220 a1 0.38 - - 0.015 - - a2 3.81 3.94 4.06 0.150 0.155 0.160 b - 1.52 - - 0.06 - b1 - 0.46 - - 0.018 - d 36.96 37.08 37.34 1.455 1.460 1.470 e - 15.24 - - 0.600 - e1 13.72 13.84 13.97 0.540 0.545 0.550 e - 2.54 - - 0.100 - l 3.18 - - 0.125 - - eb 16.00 16.51 17.02 0.630 0.650 0.670 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
7.5 28-pin skinny pdip 300mil e 1 5 o ( 4 x ) c e b a l b1 a 2 b b2 a 1 e 1.000? e 1 d pin 1 indent dimension in millimeters dimension in inches symbols min nom max min nom max a - - 4.57 - - 0.180 a1 0.38 - - 0.015 - - a2 - 3.30 3.56 - 0.130 0.140 b 1.02 - 1.65 0.0040 - 0.065 b1 0.41 - 0.58 0.016 - 0.023 b2 0.71 - 1.12 0.028 - 0.044 c 0.20 0.25 0.33 0.008 0.010 0.013 d 35.13 35.18 35.43 1.383 1.385 1.395 e 7.87 8.31 8.38 0.310 0.327 0.330 e1 7.26 7.32 7.52 0.284 0.288 0.296 e - 2.54 - - 0.100 - l 3.18 - - 0.125 - - eb 8.64 - 9.65 0.340 - 0.380 tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156
7.6 28-pin sop 300mil 0 . 0 2 0 x 4 5 o 7 o ( 4 x ) c view
7.7 28-pin ssop 209mil e d b c view
8.0 ordering information otp type mcu package type pin count package size tlc154ep pdip 18 300 mil tlc154ed sop 18 300 mil tlc154er ssop 20 209 mil tlc155ep pdip 28 600 mil tlc155em skinny pdip 28 300 mil tlc155ed sop 28 300 mil tlc155er ssop 28 209 mil tlc1 56ep pdip 18 300 mil TLC156ed sop 18 300 mil TLC156er ssop 20 209 mil tlc157ep pdip 28 600 mil tlc157em skinny pdip 28 300 mil tlc157ed sop 28 300 mil tlc157er ssop 28 209 mil mask type mcu package type pin count package size tlc154p pdip 18 300 mil tlc154d sop 18 300 mil tlc154r ssop 20 209 mil tlc155p pdip 28 600 mil tlc155m skinny pdip 28 300 mil tlc155d sop 28 300 mil tlc155r ssop 28 209 mil TLC156p pdip 18 300 mil TLC156d sop 18 300 mil TLC156r ssop 20 209 mil tlc157p pdip 28 600 mil tlc157m skinny pdip 28 300 mil tlc157d sop 28 300 mil tlc157r ssop 28 209 mil tl c t lc 1 56 rev0.95 nov 20, 2003 p.2/TLC156


▲Up To Search▲   

 
Price & Availability of TLC156

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X